<?php

declare(strict_types=1);

namespace App\Hoenix\Model;

use Hyperf\Database\Model\Relations\HasOne;
use Mine\MineModel;

/**
 * @property int $id 主键
 * @property int $idx
 * @property int $kid
 */
class HoenixKeywordIndex extends MineModel
{
    public bool $timestamps = false;
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'hoenix_keyword_index';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'idx', 'kid'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'idx' => 'integer', 'kid' => 'integer'];

    public function keyword(): HasOne
    {
        return $this->hasOne(HoenixKeyword::class, 'id', 'kid');
    }
}
